#!/bin/bash
apt -y update
apt -y install aptitude
aptitude install -y build-essential libpcre3 libpcre3-dev \
    zlib1g zlib1g-dev libssl-dev libgd-dev libxml2 \
    libxml2-dev uuid-dev openssl
wget http://nginx.org/download/nginx-1.19.6.tar.gz
tar -zxvf nginx-1.19.6.tar.gz
cd nginx-1.19.6
./configure --prefix=/var/www/html --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf --with-http_stub_status_module \
    --with-http_ssl_module --with-stream
make && make install
cd ../
rm -rf nginx-1.19.6.tar.gz nginx-1.19.6

cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
cp nginx.conf /etc/nginx/
nginx -s quit
nginx